Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usapears: implement redundant-nutrient-value filtering #1294

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

jayaddison
Copy link
Collaborator

Resolves #1289.

Copy link
Collaborator

@jknndy jknndy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the small addition & everything looks good to go!

recipe_scrapers/usapears.py Show resolved Hide resolved
Co-authored-by: Joey <7505194+jknndy@users.noreply.github.com>
@jayaddison
Copy link
Collaborator Author

Thanks @jknndy!

def nutrients(self):
container = self.soup.find("ul", {"itemprop": "nutrition"})
if not container:
raise ElementNotFoundInHtml("Could not find nutritional info container")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll merge this as-is, but a note about something I realized while self-reviewing my changes: we're a bit inconsistent throughout the codebase about usage of the arguments to the ElementNotFoundInHtml initializer, and what their purpose is. There might be an opportunity to improve the consistency/functionality there in future.

@jayaddison jayaddison merged commit ec92b83 into main Oct 17, 2024
19 checks passed
@jayaddison jayaddison deleted the issue-1289/usapears-nutrient-name-redundancy branch October 17, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

usapears: remove duplication of nutritional element names in the nutritional value text
2 participants